<?php
    header("content-type:text/html;charset=utf-8");
    session_start();
    $config = include_once('../../public/config/config.php');
    include_once('../../public/func/db.php');
    $table = 'user';
    $res = select($config,$table,'where status = 8');
    $_SESSION = array('uname'=>$res[0]['uname'],'pwd'=>$res[0]['pwd']);
    if($_POST['uname'] == $_SESSION['uname'] && md5($_POST['pwd']) == $_SESSION['pwd']){
        echo "<script>alert('Welcome!!!');window.location.href='/admin/index.php'</script>";
    }else{
        echo "<script>alert('登录失败');window.location.href='/admin/login/login.php'</script>";
    }
?>